<?php
extract ($data);
if (isset($selectedCategoryID) && $StoreCategory['id'] == $selectedCategoryID) { 
//     $tree->addItemAttribute('class', 'active'); // highlight this li 
	$active = 'active';
}else{
	$active = 'off';
}
$span_class = (isset($data['children']) && count($data['children']) == 0 ) ? 'file' : 'folder';
echo "<span class=\"{$span_class}\">".$html->link($StoreCategory['name'], array('plugin'=>'store','controller'=>'products','action' => 'display', $StoreCategory['id'],Inflector::slug($StoreCategory['name'],'-')),array('class'=>$active,'escape'=>false))."</span>";